﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JQuery.Net.UI
{
    public class ScriptContainer
    {
        #region "member variables"
        private Dictionary<jQNetEvents, string> Container = null;
        private jQNetControl _owner = null;
        #endregion

        #region "constructor"
        public ScriptContainer(jQNetControl owner)
        {
            _owner = owner;

            Container = new Dictionary<jQNetEvents, string>();
        }
        #endregion

        #region "indexer"
        public string this[jQNetEvents key]
        {
            get
            {
                return Container.ContainsKey(key)
                    ? Container[key]
                    : null;
            }
            set
            {
                if (Container.ContainsKey(key))
                {
                    Container[key] = value;
                }
                else Container.Add(key, value);
            }
        }
        #endregion

        #region "properties"
        public jQNetEvents[] Keys
        {
            get { return Container.Keys.Select((x) => x).ToArray(); }
        }
        #endregion
    }
}
